package com.joy.joyusers.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joy.joyusers.model.VO.TeamUserVO;
import com.joy.joyusers.model.domain.Team;
import com.joy.joyusers.model.domain.User;
import com.joy.joyusers.model.dto.TeamQuery;
import com.joy.joyusers.model.request.TeamJoinRequest;
import com.joy.joyusers.model.request.TeamQuitRequest;
import com.joy.joyusers.model.request.TeamUpdateRequest;

import java.util.List;

/**
* @author 40919
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-05-14 17:59:18
*/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍接口
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @return
     */
    List<TeamUserVO> listTeam(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 队伍搜索
     * @param team 查询参数的封装
     * @param loginUser 登录的用户信息
     * @return 是否成功
     */
    boolean updateTeam(TeamUpdateRequest team, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest 加入队伍参数
     * @param loginUser 当前登录用户
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest 要退出的队伍信息
     * @param loginUser 登录用户
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param id
     * @return
     */
    boolean deleteTeam(long id, User loginUser);
}
